﻿using System;
using System.Text;
using System.Collections.Generic;

namespace TeleVoyeur
{
    public class Ovni : IEquatable<Ovni>
    {
        string _tmp;
        string _key;
        string _lat;
        string _lon;
        string _vel;
        string _bea;

        public string tmp { get { return _tmp; } set { _tmp = value; } }
        public string key { get { return _key; } set { _key = value; } }
        public string lat { get { return _lat; } set { _lat = value; } }
        public string lon { get { return _lon; } set { _lon = value; } }
        public string vel { get { return _vel; } set { _vel = value; } }
        public string bea { get { return _bea; } set { _bea = value; } }

        public Ovni()
            : this("0", "0", "0.0", "0.0", "0.0", "0.0")
        {
            //
        }

        public Ovni(string tmp, string key, string lat, string lon, string vel, string bea)
        {
            _tmp = tmp;
            _key = key;
            _lat = lat;
            _lon = lon;
            _vel = vel;
            _bea = bea;
        }

        public bool Equals(Ovni other)
        {
            return (
                0 == _tmp.CompareTo(other.tmp) &&
                0 == _key.CompareTo(other.key) &&
                0 == _lat.CompareTo(other.lat) &&
                0 == _lon.CompareTo(other.lon) &&
                0 == _vel.CompareTo(other.vel) &&
                0 == _bea.CompareTo(other.bea)
            );
        }
    }

    public class GrupoOvnis
    {
        List<Ovni> _ovnis = null;

        public GrupoOvnis()
        {
            //
        }

        public GrupoOvnis(IDictionary<string, Ovni> _dic)
        {
            foreach (KeyValuePair<string, Ovni> kvp in _dic)
                ovnis.Add(kvp.Value);
        }

        public List<Ovni> ovnis
        {
            get
            {
                if (_ovnis == null)
                    _ovnis = new List<Ovni>();

                return _ovnis;
            }
            set
            {
                _ovnis = value;
            }
        }
    }
}

